<extend name="Common/main"/>
<block name="content">
    <div  style="width:100%;right:0;left:0;margin-top: 1em;text-align:center;margin-left: auto;margin-right: auto">
        <div style="width:16em;height:auto;border-radius: 10px;border:3px solid lightpink;margin-left: auto;margin-right: auto;padding-left: 1em;padding-right: 1em">
            <p style="margin-top: 3px;margin-bottom: 10px;font-size: 1.2em" id="text" >你的心愿我来接单</p>
            <p style="margin-top: 0px;margin-bottom: 0px;text-align:left;">由女生写下心愿与名字，男生来接单完成。</p>
        </div>
    </div>
    <div style="width:100%;right:0;left:0;margin-top: 1em;text-align:center;margin-left: auto;margin-right: auto">
        <form action="{:U('Index/second')}"method="post">
            <label for="myname" style="font-size: large">本人姓名:</label>
            <input style="background-color:white;zoom: 1;padding-top: 3px;padding-left: 10px;
        padding-right: 10px;padding-bottom: 3px;border-radius: 10px;border:1px solid lightpink;
        font-size: large" placeholder="本人姓名"
                   size="15" type="text" name="myname" id="myname">
            <br><br>
            <label  style="font-size: large">我的心愿</label>
            <div style="margin-left: auto;margin-right: auto; ">
            <textarea name="myword" id="myword" cols="20" rows="5" style="background-color: white;zoom: 1;padding-top: 3px;padding-bottom: 3px;
        padding-left: 10px;padding-right: 10px;border-radius: 10px;border:1px solid lightpink;
        font-size: large"></textarea>

            </div>

            <br><br>
            <p style="margin-top: -1em; display: block" id = >（心愿只能数字，字母和中文组合哦）</p>
            <p style="margin-top: -1em; display: none" id = "check"></p>
            <button id="cj" onclick="return check()" style="background-color: lightgray;font-size: large;font-family: '微软雅黑';border-radius: 10px;border:3px solid gray;">提交</button>

        </form>


    </div>
</block>

<block name="js">
    <script src="__PUBLIC__/js/jquery.js"></script>

    <script>

        function check(){
            var a = document.getElementById("check");
            var myname = document.getElementById("myname");
            var myword = document.getElementById("myword");
            var check = $('#check');

            if(isNull(myname.value)) {
                check.attr('style','display:block; color: #ff5454;');
                a.innerHTML = '本人姓名不能为空';
                return false;
            }

            if(isNull(myword.value)) {
                check.attr('style','display:block; color: #ff5454;');
                a.innerHTML = '心愿不能为空';
                return false;
            }

            return true;
        }

        function isNull( str ){
            if ( str == "" ) return true;
            var regu = "^[ ]+$";
            var re = new RegExp(regu);
            return re.test(str);
        }


    </script>
</block>